Learning Commutativity Specifications
نویسندگان
چکیده
In this work we present a new sampling-based “black box” inference approach for learning the behaviors of a library component. As an application, we focus on the problem of automatically learning commutativity specifications of data structures. This is a very challenging problem, yet important, as commutativity specifications are fundamental to program analysis, concurrency control and even lower bounds. Our approach is enabled by three core insights: (i) type-aware sampling which drastically improves the quality of obtained examples, (ii) relevant predicate discovery critical for reducing the formula search space, and (iii) an efficient search based on weighted-set cover for finding formulas ranging over the predicates and capturing the examples. More generally, our work learns formulas belonging to fragments consisting of quantifier-free formulas over a finite number of relation symbols. Such fragments are expressive enough to capture useful specifications (e.g., commutativity) yet are amenable to automated inference. We implemented a tool based on our approach and have shown that it can quickly learn non-trivial and important commutativity specifications of fundamental data types such as hash maps, sets, array lists, union find and others. We also showed experimentally that learning these specifications is beyond the capabilities of existing techniques.
منابع مشابه
On the Completeness of Context-Sensitive Order-Sorted Specifications
We propose three different notions of completeness for term rewrite specifications supporting order-sorted signatures, deduction modulo axioms, and context-sensitive rewriting relative to a replacement map μ. Our three notions are: (1) an appropriate definition of μ-sufficient completeness with respect to a set of constructor symbols; (2) a definition of μ-canonical completeness under which μ-c...
متن کاملA Church-Rosser Checker Tool for Conditional Order-Sorted Equational Maude Specifications
The (ground) Church-Rosser property, together with termination, is essential for an equational specification to have good executability conditions, and also for having a complete agreement between the specification’s initial algebra, mathematical semantics, and its operational semantics by rewriting. Checking this property for expressive specifications that are order-sorted, conditional with po...
متن کاملCommutativity Condition Refinement
We present a technique for automatically generatingcommutativity conditions from (abstract-level) data-structurespecifications. We observe that one can pose the commutativityquestion in a way that does not introduce additional quantifiers,via a mechanized lifting of a (potentially partial) specificationto an equivalent total specification. We then describe an al-gorithm ...
متن کاملFirst-order theorem proving modulo equations
We present refutationally complete calculi for first-order clauses with equality. General paramodulation calculi cannot efficiently deal with equations such as associativity and commutativity axioms. Therefore we will separate a set of equations (called E-equations) from a specification and give them a special treatment, avoiding paramodulations with E-equations but using E-unification for the ...
متن کاملOrder-Sorted Equality Enrichments Modulo Axioms
Built-in equality and inequality predicates based on comparison of canonical forms in algebraic specifications are frequently used because they are handy and efficient. However, their use places algebraic specifications with initial algebra semantics beyond the pale of theorem proving tools based, for example, on explicit or inductionless induction techniques, and of other formal tools for chec...
متن کامل